package com.kanq.service.designpatterns.singleton;

/**
 * @Author cheng jun
 * @Description: 懒汉式：解决了线程同步问题，也解决了反序列化问题
 * @Date 2021/7/13 20:19
 */
public enum Demo3 {

    INSTANCE;

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                System.out.println(Demo3.INSTANCE.hashCode());
            }).start();
        }
    }
}
